package com.szrt.day20170405.ch01;

public class Demo06 {
	
	
	
	//三目运算符
	public static void main(String[] args) {
		
		
		
		//考试
		int age=9;
		
		boolean chengnianma =age>=18?true:false;
		
		System.out.println(chengnianma);
		
		
		
		/*int a =5;
		
		int y;
		
		y=a>20?25-1:15+1;
		System.out.println(y);*/
		
		
		int a =5;
		int y;
		y=a>20?25-1:(a>=5?12:8);
		System.out.println(y);
	}

}
